<?php

$cfg = array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'language'=>'vi',

	// preloading 'log' component
	'preload'=>array(
		'bootstrap'
		,'log'
	),

	'import'=>array(
		'application.models.*',
		'application.models.formValidate.*',
		'application.components.*',
	),

	'modules'=>array(
		'hqUser'=>array(
			'class'=>'ext.Hq.openIDUserModule.OpenIdUserModule',

			'roles'=>array('ADMIN','MODE'),

			'userComponentName'=>'hqUser',
		),

		'hq'=>array(
			'class' => 'application.modules.hq.HqModule',
		),
	),

	'controllerMap'=>array(

	),
	// application components
	'components'=>array(
		'user'=>array(
			'allowAutoLogin'=>true,
			'loginUrl'=>'/account/login',
		),

		'registry'=>array(
			'class'=>'ext.common.registry.RegistryComponent',
		),

		'bootstrap'=>array(
			'class'=>'ext.common.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
		),

		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),

		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName'=>false,
			'rules'=>array(
				'<_c:\w+>/'=>'<_c>/',
				'<_c:\w+>/<_a:\w+>'=>'<_c>/<_a>',
				'<_m:\w+>/<_c:\w+>/<_a:\w+>'=>'<_m>/<_c>/<_a>',
			),
		),

		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CDbLogRoute',

					'logTableName'=>'yii_log',
					'connectionID'=>'db',
					'levels'=>'error, warning',
				),
				array(
					'class'=>'CProfileLogRoute',
				),
			),
		),

		'hqUser'=>array(
			'class'=>'ext.Hq.HqUserComponent',
			'allowAutoLogin'=>false,
			'loginUrl'=>array('/hqUser/signIn'),
		),

		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=sro',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'schemaCachingDuration'=>3600,
		),
	),

	// application-level parameters that can be accessed
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);

if (defined('YII_DEBUG') && YII_DEBUG) $cfg = CMap::mergeArray(
	$cfg,
	require dirname(__FILE__).DIRECTORY_SEPARATOR.'debug.php'
);

$cfg = CMap::mergeArray(
	$cfg,
	require dirname(__FILE__).DIRECTORY_SEPARATOR.'module.php'
);

return $cfg;